// 云函数入口文件
const cloud = require('wx-server-sdk')
const rq = require('request-promise')
cloud.init()
//创建URL
exports.main=async(event,context)=>{
   let url = `https://api.wmdb.tv/api/v1/top?type=Douban&skip=${event.skip}&limit=${event.limit}&lang=${event.lang}`
//发送ajax
return rq(url).then(res=>{
        return res;
}) .catch(err=>{
    console.log(err)
})
}
